export function date(str?: string) {
  const date = new Date();
  const Year = date.getFullYear();
  const Month = date.getMonth() + 1;
  const Day = date.getDate();
  const Hours: number | string =
    date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
  const Minutes: number | string =
    date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  const Seconds: number | string =
    date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  const time = `${Year}-${Month}-${Day} ${Hours}:${Minutes}:${Seconds}`;
  if (str === "all") {
    return time as string;
  }
  return time;
}
